﻿<Page
    x:Name="pageRoot"
    x:Class="TranshumanityNet.ItemsDetailPage"
    DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:TranshumanityNet"
    xmlns:common="using:TranshumanityNet.Common"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Page.Resources>
        <!-- Collection of items displayed by this page -->
        <CollectionViewSource
            x:Name="itemsViewSource"
            Source="{Binding Items}"/>
    </Page.Resources>
 
    <Grid DataContext="{Binding Group}" Background="White" >
        <Grid.ChildrenTransitions>
            <TransitionCollection>
                <EntranceThemeTransition/>
            </TransitionCollection>
        </Grid.ChildrenTransitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="140"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
 
        <Grid Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="15*" />
                <ColumnDefinition Width="50*" />
            </Grid.ColumnDefinitions>
            <TextBlock x:Name="SourceTxt" Text="{Binding Description}" Width="400" Margin="0,0,0,0" Style="{StaticResource BodyTextBlockStyle}" HorizontalAlignment="Left" Visibility="Collapsed" /> 
            <!--<Image Source="{Binding ImagePath}" Width="200" Height="250" Margin="20,20,0,20" HorizontalAlignment="Left" Stretch="UniformToFill" 
                   AutomationProperties.Name="{Binding Title}" 
                   />-->
            <TextBlock Margin="0,0,0,20" Style="{StaticResource SubheaderTextBlockStyle}" MaxHeight="60" HorizontalAlignment="Left" Width="405" Visibility="Collapsed"><Hyperlink x:Name="UrlTarget"
                Foreground="White" NavigateUri="{Binding Link}" >Link to Netflix</Hyperlink></TextBlock>
 
            <WebView x:Name="HTMLContentHere" Margin="5,0,5,0" Grid.Column="0" Grid.ColumnSpan="2" /> 
        </Grid>

        <!-- Back button and page title -->
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="120"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Button x:Name="backButton" Margin="39,59,39,0" Command="{Binding NavigationHelper.GoBackCommand, ElementName=pageRoot}"
                        Style="{StaticResource NavigationBackButtonNormalStyle2}" BorderBrush="Black" Foreground="Black"
                        VerticalAlignment="Top"
                        AutomationProperties.Name="Back"
                        AutomationProperties.AutomationId="BackButton"
                        AutomationProperties.ItemType="Navigation Button"/>
            <TextBlock x:Name="pageTitle" Text="{Binding Title}" Style="{StaticResource HeaderTextBlockStyle}" Grid.Column="1" 
                        IsHitTestVisible="false" TextWrapping="NoWrap" VerticalAlignment="Bottom" Margin="0,0,30,40" Foreground="Black"/>
        </Grid>
    </Grid>
    <Page.BottomAppBar  >
        <AppBar Padding="10,0,10,0" >
            <Grid Margin="110,0,100,0">
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" > 
                    <TextBlock Text="open directly" VerticalAlignment="Bottom"  Margin="0,0,20,10" />
                </StackPanel>
                
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" > 
                    <Button x:Name="NewIcon" Style="{StaticResource AppBarButtonStyle}" Click="Open_Click" >
                        <Image Source="/Assets/appbar.ie.png" />
                    </Button>
                </StackPanel> 
            </Grid>
        </AppBar>
    </Page.BottomAppBar>
</Page>
